<template>
<div>
    <!-- 点击添加按钮，弹框 -->
    <el-button type="primary" @click="willAdd">添加</el-button>
    <!-- 表格 -->
    <list-vue @willUpdate="willUpdate" :arr="arr" @init="getlist"></list-vue>

    <!-- 弹框 -->
    <form-vue :info="info" :arr="arr" @init="getlist" ref='form'></form-vue>
</div>
</template>
<script>
import listVue from './components/list.vue'
import formVue from './components/form.vue'
import {mapGetters,mapActions} from 'vuex'
import { reqmenulist } from '../../http/api'
import { toggle } from "../../mixins";

export default {
    components:{
        listVue,
        formVue,
    },
props:[],
mixins: [toggle],

data(){
return{
    // info:{
    //     isshow:false,
    //     isAdd:true,
    //     //初始化列表数据
        
    // },
    arr:[],
}
},
computed:{
...mapGetters({}),
},
mounted(){
    this.getlist()
    
},
methods:{
...mapActions({}),
//添加

getlist(){
    reqmenulist({istree:true}).then((res)=>{
        if(res.data.code==200){
            // console.log(res);
            this.arr=res.data.list?res.data.list:[];
        }
    })
}
}
}
</script>
<style scoped lang='less'>
@import '../../less/index.less';
</style>